package com.cn.longdistancebusstation.city;

import com.cn.longdistancebusstation.model.Station;

import java.util.Comparator;

/**
 * @author xiaanming
 */
public class PinyinComparator implements Comparator<Station> {

    public int compare(Station o1, Station o2) {
        if (o1.getStationCode().equals("@")
                || o2.getStationCode().equals("#")) {
            return -1;
        } else if (o1.getStationCode().equals("#")
                || o2.getStationCode().equals("@")) {
            return 1;
        } else {
            return o1.getStationCode().compareTo(o2.getStationCode());
        }
    }

}
